package com.yl.auth.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.entity.ChuyuanjiesuanBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


@Mapper
public interface ChuyuanjiesuanMapper extends BaseMapper<ChuyuanjiesuanBean> {
//    @Select("select chu.bed_no,f.room_no,l.`name` lname,l.gender,l.id_number,c.scheduled_time,c.cause,state FROM chuyuan c \n" +
//            "LEFT JOIN laoren l on c.`name` = l.id \n" +
//            "LEFT JOIN chuangwei chu on l.bed_id = chu.id \n" +
//            "LEFT JOIN fangjian f on chu.room_id = f.id")
    IPage<ChuyuanjiesuanBean> selepage(Page<ChuyuanjiesuanBean> ipage, @Param("chu") ChuyuanjiesuanBean wrapper);
//    IPage<CunYao> getAllPage(IPage<CunYao> ipage, @Param(Constants.WRAPPER) QueryWrapper<CunYao> wrapper);

    ChuyuanjiesuanBean getById(@Param("id") Long id);

    @Update("update chuyuan set state=1 where id=#{id}")
    void updatechuyuan(Long id);

}
